#!/bin/bash
# Make sure the script runs with super user privileges.
[ "$UID" -eq 0 ] || exec sudo bash "$0" "$@"
can_channel=vcan1
# Load the kernel module.
modprobe $can_channel
# Create the virtual CAN interface.
ip link add dev $can_channel type vcan
ip link set up $can_channel
# don't del echo
echo "can_channel=${can_channel}"